<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>ReactRef</title>
    <script src="js/react.js"></script>
    <script src="js/react-dom.js"></script>
    <script src="js/browser.min.js"></script>
    <script src="js/JSXTransformer.js"></script>
    <script src="js/jquery-1.11.3.js"></script>
</head>
<body>
    <div id="example"></div>
    <script type="text/babel">
        var MyComponent = React.createClass({
            handleClick:function(){
                /*this.refs.myInput.focus();
                this.refs.myInput.value="聚焦" ;*/
                this.getDOMNode('myInput').focus();
            },
            render:function(){
                return (
                        <div>
                            <input type="text" ref="myInput" />
                            <input type="button"  value="获取焦点" onClick={this.handleClick}/>
                        </div>
                );
            }
        });
        ReactDOM.render(
                <MyComponent />,
                document.getElementById('example')
        );
    </script>
</body>
</html>